package com.example.easyexcel.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.example.easyexcel.entity.User;

import java.util.Map;

/**
 * @Description :
 * @Author : Bruce Lee
 * @CreateTime : 2024/6/4
 */

public class ExcelListener extends AnalysisEventListener<Object> {

    /**
     * 一行一行的读取excel内容
     */
    @Override
    public void invoke(Object data, AnalysisContext analysisContext) {
        System.out.println("一行数据：" + data);
    }

    /**
     * 读取表头内容
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头数据：" + headMap);
    }

    /**
     * 读取完成操作
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
//        System.out.println("读取Excel完毕");
    }

}
